package code;

import weka.core.Instances;
import weka.filters.Filter;
import weka.filters.unsupervised.attribute.Normalize;
import weka.filters.unsupervised.instance.Randomize;

public class Preproceso {

	//ATTRIBUTES
	private static Preproceso preproceso = new Preproceso();

	private Preproceso() {}

	public static Preproceso getInstance() {
	        return preproceso;
	}
	
	public Instances randomizar(Instances data){
		Randomize r = new Randomize();
		try {
			r.setInputFormat(data);
			data = Filter.useFilter(data, r);
		} catch (Exception e) {
			System.out.println("Error Randomize");	
		} 
		return data;
	}
	
	public Instances normalizar(Instances data) {
		Normalize n = new Normalize();
		try {
			n.setInputFormat(data);
			data = Filter.useFilter(data, n);
		} catch (Exception e) {
			System.out.println("Error Normalize");
		}
		return data;
	}

}
